<?php
require 'MySql.php';
$config = [
    'host' => 'localhost',
    'user' => 'root',
    'password' => 'root',
    'database' => 'bd_laravel',
    'charset' => 'utf8'
];

$pdo = new MySql($config);
//$query = $pdo->query("SELECT * FROM bd_roles WHERE id = :id",[':id'=>3]);
//$execute = $pdo->execute("UPDATE bd_roles SET name=? WHERE id = ?",['喜洋洋',2]);
//var_dump($execute);
//$res = $pdo->table('bd_roles')->field('id','name')->limit(1,10)->where('id>1')->orderBy('id asc')->get();

//$res = $pdo->table('bd_roles')->insert(['name'=>'liuhouse','created_at'=>'2020-05-29 11:09:14']);
try {
//    $res = $pdo->table('bd_roles')->where('id > 4')->update(['name'=>'sqzr']);
    #进行删除操作
    $res = $pdo->table('bd_roles')->where('id=3')->delete();
    var_dump($res);
}catch (Exception $e){
    echo $e->getMessage();
}
